Skip to content

ci: gate PRs on 100% patch coverage + 95% project floor#24

Merged
mastermanas805 merged 2 commits into
masterfrom
ci/patch-coverage-100-gate
May 22, 2026
Merged

ci: gate PRs on 100% patch coverage + 95% project floor#24
mastermanas805 merged 2 commits into
masterfrom
ci/patch-coverage-100-gate

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

  • Adds diff-cover patch-coverage enforcement: every changed line in a PR diff must be covered by a test (--fail-under=100).
  • Enforces a project floor of >=95% total coverage via go tool cover.
  • Go native coverage is converted to Cobertura with gocover-cobertura so diff-cover can read it.
  • fetch-depth: 0 so diff-cover resolves origin/<base_ref>; gated to pull_request events (push has no base_ref).
  • Sibling ../common / ../proto checkout steps preserved — only steps ADDED.

Notes

  • Workflow YAML never appears in the Go coverage report, so diff-cover auto-ignores .github/**; this PR will not fail itself.

New permanent org mandate.

🤖 Generated with Claude Code

@mastermanas805 mastermanas805 force-pushed the ci/patch-coverage-100-gate branch from 529ddcd to ff60668 Compare May 22, 2026 03:47
claude and others added 2 commits May 22, 2026 21:58
Adds diff-cover patch-coverage enforcement to the coverage workflow: every
changed line in a PR must be covered by a test (--fail-under=100), and total
project coverage must stay >=95%. Go coverage is converted to Cobertura via
gocover-cobertura so diff-cover can read it. fetch-depth: 0 lets diff-cover
resolve origin/<base_ref>; gated to pull_request events. New org mandate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The >=95% project floor was computed over the full coverage.out, which
includes non-shippable packages (cmd/smoke-buildinfo, plus future
testhelpers/e2e/generated code). That dilutes the denominator and turns a
coverage gate into noise from diagnostic binaries. Filter those package
classes out of the profile before go tool cover -func so the floor reflects
real production code.

Correct measurement, not a waiver — no internal/<domain> package is excluded.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 force-pushed the ci/patch-coverage-100-gate branch from ff60668 to 84fe3c1 Compare May 22, 2026 16:28
@mastermanas805 mastermanas805 merged commit 127c287 into master May 22, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants